<script>
import { getSpreadRinkingReport } from '@/api/overview/spread'
import TitleChart from '@/components/EChart/TitleChart'

export default {
  name: 'mixin',
  props: {
    reportData: {
      type: Object
    }
  },
  components: {
    TitleChart
  },
  methods: {
    getParams() {
      return {}
    },
    getRankingStat(
      statNames,
      topCount = -1
    ) {
      return new Promise((resolve, reject) => {
        getSpreadRinkingReport({
          sensitiveFlag: this.reportData.data.sensitiveFlag,
          topCount,
          statNames: statNames,
          aggFilterConds: this.getParams()
        }).then(res => {
          if (res && res.code === 200) {
            resolve(res.data)
          } else {
            reject(res)
          }
        })
      })
    }
  }
}
</script>

<style scoped lang="scss">

</style>
